<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <title>添加类型</title>
</head>

<style>
    .width{
        width: 300px!important;
    }
    .width-btn{
        width: 150px!important;
    }
</style>

<body>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
    <div class="container animated fadeIn">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3>添加类型</h3>
                <hr>
            </div>
            <div class="panel-body">
                <div class="col-md-11 col-md-offset-1">
                    <form action="#" role="form" th:action="@{/admindisk/newtype}" id="typeform" method="post">
                        <input type="text" id="typenameValue" name="typeName" class="form-control width" placeholder="请输入添加内容...">
                        <br>
                        <input type="button" onclick="submitForm();" class="btn btn-success width-btn" value="添加">
                        <a href="#" onClick="javascript :history.back(-1);" class="btn btn-default width-btn">返回</a>
                    </form>
                </div>
            </div>
        </div>
    </div>


<script src="../static/js/jq.js" th:src="@{/js/jq.js}"></script>
<script>
    function submitForm() {
        var value = document.getElementById("typenameValue").value;
        if ("" != value){
            $("#typeform").submit();
        }else{
            alert("内容不能为空!");
        }
    }
</script>

</body>
</html>